<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:msds="http://matsadaml.org/msds/v1.0"
	xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0"
	xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
	xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0"
	xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0"
	xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"
	xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
	xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0"
	xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"
	xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0"
	xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"
	xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0"
	xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"
	xmlns:math="http://www.w3.org/1998/Math/MathML"
	xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
	xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
	xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer"
	xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events"
	xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:strip-space elements="*"/>
	<!--Create root node-->
	<xsl:template match="msds:product">
		<office:document-content office:version="1.1">
			<office:scripts/>
			<office:font-face-decls>
				<style:font-face style:name="Arial" svg:font-family="Arial"
					style:font-family-generic="swiss" style:font-pitch="variable"/>
				<style:font-face style:name="Arial Unicode MS"
					svg:font-family="&apos;Arial Unicode MS&apos;"
					style:font-family-generic="system" style:font-pitch="variable"/>
				<style:font-face style:name="Tahoma" svg:font-family="Tahoma"
					style:font-family-generic="system" style:font-pitch="variable"/>
			</office:font-face-decls>
			<office:automatic-styles>
				<style:style style:name="co1" style:family="table-column">
					<style:table-column-properties fo:break-before="auto"
						style:column-width="0.915cm"/>
				</style:style>
				<style:style style:name="co2" style:family="table-column">
					<style:table-column-properties fo:break-before="auto"
						style:column-width="2.371cm"/>
				</style:style>
				<style:style style:name="co3" style:family="table-column">
					<style:table-column-properties fo:break-before="auto"
						style:column-width="2.746cm"/>
				</style:style>
				<style:style style:name="co4" style:family="table-column">
					<style:table-column-properties fo:break-before="auto"
						style:column-width="4.882cm"/>
				</style:style>
				<style:style style:name="co5" style:family="table-column">
					<style:table-column-properties fo:break-before="auto"
						style:column-width="8.879cm"/>
				</style:style>
				<style:style style:name="co6" style:family="table-column">
					<style:table-column-properties fo:break-before="auto"
						style:column-width="6.937cm"/>
				</style:style>
				<style:style style:name="co7" style:family="table-column">
					<style:table-column-properties fo:break-before="auto"
						style:column-width="2.267cm"/>
				</style:style>
				<style:style style:name="ro1" style:family="table-row">
					<style:table-row-properties style:row-height="0.538cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ro2" style:family="table-row">
					<style:table-row-properties style:row-height="0.552cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ro3" style:family="table-row">
					<style:table-row-properties style:row-height="0.453cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ro4" style:family="table-row">
					<style:table-row-properties style:row-height="0.579cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ro5" style:family="table-row">
					<style:table-row-properties style:row-height="1.42cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ro6" style:family="table-row">
					<style:table-row-properties style:row-height="0.478cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ro7" style:family="table-row">
					<style:table-row-properties style:row-height="0.573cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ro8" style:family="table-row">
					<style:table-row-properties style:row-height="0.526cm" fo:break-before="auto"
						style:use-optimal-row-height="true"/>
				</style:style>
				<style:style style:name="ta1" style:family="table" style:master-page-name="Default">
					<style:table-properties table:display="true" style:writing-mode="lr-tb"/>
				</style:style>
				<number:date-style style:name="N30" number:automatic-order="true"
					number:format-source="language">
					<number:year/>
					<number:text>-</number:text>
					<number:month/>
					<number:text>-</number:text>
					<number:day/>
				</number:date-style>
				<style:style style:name="ce1" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:border-left="0.035cm solid #000000"
						fo:border-right="0.002cm solid #c0c0c0"
						fo:border-top="0.035cm solid #000000"/>
					<style:text-properties fo:color="#004a4a" fo:font-weight="bold"
						style:font-weight-asian="bold" style:font-weight-complex="bold"/>
				</style:style>
				<style:style style:name="ce2" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.035cm solid #000000"
						fo:padding="0.085cm" fo:border-right="0.002cm solid #c0c0c0"
						fo:border-top="0.035cm solid #000000"/>
				</style:style>
				<style:style style:name="ce3" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.035cm solid #000000"
						fo:padding="0.085cm" fo:border-right="0.002cm solid #c0c0c0"
						fo:border-top="0.002cm solid #c0c0c0"/>
				</style:style>
				<style:style style:name="ce4" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.035cm solid #000000"
						fo:padding="0.085cm" fo:border-right="0.002cm solid #c0c0c0"
						fo:border-top="0.002cm solid #c0c0c0"/>
				</style:style>
				<style:style style:name="ce5" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border="0.035cm solid #000000"/>
					<style:text-properties fo:color="#004a4a" fo:font-weight="bold"
						style:font-weight-asian="bold" style:font-weight-complex="bold"/>
				</style:style>
				<style:style style:name="ce6" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.035cm solid #000000"
						fo:padding="0.085cm" fo:border-right="0.035cm solid #000000"
						fo:border-top="none"/>
				</style:style>
				<style:style style:name="ce7" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.035cm solid #000000"
						fo:padding="0.085cm" fo:border-right="0.035cm solid #000000"
						fo:border-top="0.002cm solid #c0c0c0"/>
				</style:style>
				<style:style style:name="ce8" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.035cm solid #000000"
						fo:padding="0.085cm" fo:border-right="0.035cm solid #000000"
						fo:border-top="0.002cm solid #c0c0c0"/>
				</style:style>
				<style:style style:name="ce9" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:background-color="#ffffcc"
						style:cell-protect="none" style:print-content="true"
						fo:border="0.002cm solid #000000" fo:padding="0.085cm"/>
				</style:style>
				<style:style style:name="ce10" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:border-left="0.002cm solid #c0c0c0"
						fo:border-right="0.035cm solid #000000"
						fo:border-top="0.035cm solid #000000"/>
					<style:text-properties fo:color="#004a4a" fo:font-weight="bold"
						style:font-weight-asian="bold" style:font-weight-complex="bold"/>
				</style:style>
				<style:style style:name="ce11" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.002cm solid #c0c0c0"
						fo:padding="0.085cm" fo:border-right="0.035cm solid #000000"
						fo:border-top="0.035cm solid #000000"/>
				</style:style>
				<style:style style:name="ce12" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.002cm solid #c0c0c0"
						fo:padding="0.085cm" fo:border-right="0.035cm solid #000000"
						fo:border-top="0.002cm solid #c0c0c0"/>
				</style:style>
				<style:style style:name="ce13" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.002cm solid #c0c0c0"
						fo:padding="0.085cm" fo:border-right="0.035cm solid #000000"
						fo:border-top="0.002cm solid #c0c0c0"/>
				</style:style>
				<style:style style:name="ce14" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:background-color="#ffffcc"
						style:cell-protect="none" style:print-content="true"
						fo:border="0.035cm solid #000000" fo:padding="0.085cm"/>
				</style:style>
				<style:style style:name="ce15" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:border-left="0.002cm solid #c0c0c0"
						fo:border-right="0.002cm solid #c0c0c0"
						fo:border-top="0.035cm solid #000000"/>
					<style:text-properties fo:color="#004a4a" fo:font-weight="bold"
						style:font-weight-asian="bold" style:font-weight-complex="bold"/>
				</style:style>
				<style:style style:name="ce16" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.002cm solid #c0c0c0"
						fo:padding="0.085cm" fo:border-right="0.002cm solid #c0c0c0"
						fo:border-top="0.035cm solid #000000"/>
				</style:style>
				<style:style style:name="ce17" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:background-color="#ffffcc"
						style:cell-protect="none" style:print-content="true"
						fo:border="0.002cm solid #c0c0c0" fo:padding="0.085cm"/>
				</style:style>
				<style:style style:name="ce18" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" fo:border-left="0.002cm solid #c0c0c0"
						fo:padding="0.085cm" fo:border-right="0.002cm solid #c0c0c0"
						fo:border-top="0.002cm solid #c0c0c0"/>
				</style:style>
				<style:style style:name="ce19" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" style:text-align-source="fix"
						style:repeat-content="false" fo:wrap-option="wrap"
						fo:border-left="0.002cm solid #c0c0c0" fo:padding="0.085cm"
						fo:border-right="0.035cm solid #000000"
						fo:border-top="0.035cm solid #000000"/>
					<style:paragraph-properties fo:text-align="start" fo:margin-left="0cm"/>
				</style:style>
				<style:style style:name="ce20" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" style:text-align-source="fix"
						style:repeat-content="false" fo:wrap-option="wrap"
						fo:border-left="0.002cm solid #c0c0c0" fo:padding="0.085cm"
						fo:border-right="0.035cm solid #000000"
						fo:border-top="0.002cm solid #c0c0c0"/>
					<style:paragraph-properties fo:text-align="start" fo:margin-left="0cm"/>
				</style:style>
				<style:style style:name="ce21" style:family="table-cell"
					style:parent-style-name="Default" style:data-style-name="N30">
					<style:table-cell-properties fo:border-bottom="0.002cm solid #c0c0c0"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" style:text-align-source="fix"
						style:repeat-content="false" fo:wrap-option="wrap"
						fo:border-left="0.002cm solid #c0c0c0" fo:padding="0.085cm"
						fo:border-right="0.035cm solid #000000"
						fo:border-top="0.002cm solid #c0c0c0"/>
					<style:paragraph-properties fo:text-align="start" fo:margin-left="0cm"/>
				</style:style>
				<style:style style:name="ce22" style:family="table-cell"
					style:parent-style-name="Default">
					<style:table-cell-properties fo:border-bottom="0.035cm solid #000000"
						fo:background-color="#ffffcc" style:cell-protect="none"
						style:print-content="true" style:text-align-source="fix"
						style:repeat-content="false" fo:wrap-option="wrap"
						fo:border-left="0.002cm solid #c0c0c0" fo:padding="0.085cm"
						fo:border-right="0.035cm solid #000000"
						fo:border-top="0.002cm solid #c0c0c0"/>
					<style:paragraph-properties fo:text-align="start" fo:margin-left="0cm"/>
				</style:style>
			</office:automatic-styles>
			<office:body>
				<office:spreadsheet>
					<table:table table:name="product" table:style-name="ta1" table:print="false">
						<office:forms form:automatic-focus="false" form:apply-design-mode="false"/>
						<table:table-column table:style-name="co1"
							table:default-cell-style-name="Default"/>
						<table:table-column table:style-name="co2"
							table:default-cell-style-name="Default"/>
						<table:table-column table:style-name="co3"
							table:default-cell-style-name="Default"/>
						<table:table-column table:style-name="co4"
							table:default-cell-style-name="Default"/>
						<table:table-column table:style-name="co5"
							table:default-cell-style-name="Default"/>
						<table:table-column table:style-name="co6"
							table:default-cell-style-name="Default"/>
						<!--Create the Product id section-->
						<table:table-row table:style-name="ro1">
							<table:table-cell table:style-name="msds-Section"
								office:value-type="string">
								<text:p>Product</text:p>
							</table:table-cell>
							<table:table-cell table:number-columns-repeated="5"/>
						</table:table-row>
						<table:table-row table:style-name="ro2">
							<table:table-cell/>
							<table:table-cell office:value-type="string">
								<text:p>id</text:p>
							</table:table-cell>
							<table:table-cell table:style-name="ce9" office:value-type="string">
								<text:p>
									<xsl:value-of select="@id"/>
								</text:p>
							</table:table-cell>
							<table:table-cell table:number-columns-repeated="3"/>
						</table:table-row>
						<table:table-row table:style-name="ro3">
							<table:table-cell table:number-columns-repeated="6"/>
						</table:table-row>
						<!--Create the product Name section-->
						<table:table-row table:style-name="ro1">
							<table:table-cell table:style-name="msds-Section"
								office:value-type="string">
								<text:p>Name</text:p>
							</table:table-cell>
							<table:table-cell table:number-columns-repeated="5"/>
						</table:table-row>
						<table:table-row table:style-name="ro3">
							<table:table-cell/>
							<table:table-cell table:style-name="ce1" office:value-type="string">
								<text:p>Countries</text:p>
							</table:table-cell>
							<table:table-cell table:style-name="ce15" office:value-type="string">
								<text:p>lang</text:p>
							</table:table-cell>
							<table:table-cell table:style-name="ce10" office:value-type="string">
								<text:p>Name</text:p>
							</table:table-cell>
							<table:table-cell table:number-columns-repeated="3"/>
						</table:table-row>
						<!--Create one row for each msds:name node-->
						<xsl:for-each select="msds:name">
							<table:table-row table:style-name="ro2">
								<table:table-cell/>
								<table:table-cell table:style-name="ce3" office:value-type="string">
									<text:p>
										<xsl:value-of select="@countries"/>
									</text:p>
								</table:table-cell>
								<table:table-cell table:style-name="ce17" office:value-type="string">
									<text:p>
										<xsl:value-of select="@lang"/>
									</text:p>
								</table:table-cell>
								<table:table-cell table:style-name="ce12" office:value-type="string">
									<text:p>
										<xsl:value-of select="."/>
									</text:p>
								</table:table-cell>
								<table:table-cell table:number-columns-repeated="3"/>
							</table:table-row>
						</xsl:for-each>
						<!--
							Create two empty data entry rows and one empty white row after
							this section
						-->
						<table:table-row table:style-name="ro2">
							<table:table-cell/>
							<table:table-cell table:style-name="ce3"/>
							<table:table-cell table:style-name="ce17"/>
							<table:table-cell table:style-name="ce12"/>
							<table:table-cell table:number-columns-repeated="3"/>
						</table:table-row>
						<table:table-row table:style-name="ro2">
							<table:table-cell/>
							<table:table-cell table:style-name="ce4"/>
							<table:table-cell table:style-name="ce18"/>
							<table:table-cell table:style-name="ce13"/>
							<table:table-cell table:number-columns-repeated="3"/>
						</table:table-row>
						<table:table-row table:style-name="ro3">
							<table:table-cell table:number-columns-repeated="6"/>
						</table:table-row>
						<!--Start doing tricks for the other nodes-->
						<xsl:apply-templates/>
					</table:table>
				</office:spreadsheet>
			</office:body>
		</office:document-content>
	</xsl:template>
	<!--Create the Company section-->
	<xsl:template match="msds:company">
		<table:table-row table:style-name="ro1">
			<table:table-cell table:style-name="msds-Section" office:value-type="string">
				<text:p>Company</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="5"/>
		</table:table-row>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell office:value-type="string">
				<text:p>key</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce14" office:value-type="string">
				<text:p>
					<xsl:value-of select="@key"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="3"/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell table:number-columns-repeated="6"/>
		</table:table-row>
	</xsl:template>
	<!--Create all paragraph sections-->
	<xsl:template
		match="msds:information | msds:hazardsIdentification | msds:comment | msds:firstAidMeasures | msds:fireFightingMeasures | msds:accidentalReleaseMeasures | 
	msds:handlingAndStorage | msds:personalProtection | msds:properties | msds:stability | msds:toxicology | msds:ecotoxicology | msds:disposal | msds:transportation | 
	msds:otherInformation">
		<table:table-row table:style-name="ro1">
			<!--Create title for the section-->
			<table:table-cell table:style-name="msds-Section" office:value-type="string">
				<text:p>
					<xsl:choose>
						<xsl:when test="local-name(.) = 'information'">
							<xsl:text>Information</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'hazardsIdentification'">
							<xsl:text>Hazards identification</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'comment'">
							<xsl:text>Comment</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'firstAidMeasures'">
							<xsl:text>First aid measures</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'fireFightingMeasures'">
							<xsl:text>Fire fighting measures</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'accidentalReleaseMeasures'">
							<xsl:text>Accidental release measures</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'handlingAndStorage'">
							<xsl:text>Handling and storage</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'personalProtection'">
							<xsl:text>Personal protection</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'properties'">
							<xsl:text>Properties</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'stability'">
							<xsl:text>Stability</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'toxicology'">
							<xsl:text>Toxicology</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'ecotoxicology'">
							<xsl:text>Ecotoxicology</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'disposal'">
							<xsl:text>Disposal</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'transportation'">
							<xsl:text>Transportation</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'otherInformation'">
							<xsl:text>Other information</xsl:text>
						</xsl:when>
					</xsl:choose>
				</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="5"/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell/>
			<table:table-cell table:style-name="ce1" office:value-type="string">
				<text:p>pos</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>Countries</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>lang</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>title</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce10" office:value-type="string">
				<text:p>text</text:p>
			</table:table-cell>
			<table:table-cell/>
		</table:table-row>
		<!--Apply templates-->
		<xsl:apply-templates/>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce3"/>
			<table:table-cell table:style-name="ce17"/>
			<table:table-cell table:style-name="ce17"/>
			<table:table-cell table:style-name="ce17"/>
			<table:table-cell table:style-name="ce20"/>
			<table:table-cell/>
		</table:table-row>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce4"/>
			<table:table-cell table:style-name="ce18"/>
			<table:table-cell table:style-name="ce18"/>
			<table:table-cell table:style-name="ce18"/>
			<table:table-cell table:style-name="ce22"/>
			<table:table-cell/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell table:number-columns-repeated="6"/>
		</table:table-row>
	</xsl:template>
	<!--Create a Paragraph row-->
	<xsl:template match="msds:paragraph | msds:step">
		<table:table-row table:style-name="ro4">
			<table:table-cell/>
			<table:table-cell table:style-name="ce3" office:value-type="string">
				<text:p>
					<xsl:value-of select="@pos"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce17" office:value-type="string">
				<text:p>
					<xsl:value-of select="@countries"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce17" office:value-type="string">
				<text:p>
					<xsl:value-of select="@lang"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce17" office:value-type="string">
				<text:p>
					<xsl:value-of select="normalize-space(msds:title)"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce20" office:value-type="string">
				<text:p>
					<xsl:value-of select="normalize-space(msds:text)"/>
				</text:p>
			</table:table-cell>
			<table:table-cell/>
		</table:table-row>
	</xsl:template>
	<!--Create the Substances section-->
	<xsl:template match="msds:substances">
		<table:table-row table:style-name="ro1">
			<!--Create title for the section-->
			<table:table-cell table:style-name="msds-Section" office:value-type="string">
				<text:p>Substances</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="6"/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell/>
			<table:table-cell table:style-name="ce1" office:value-type="string">
				<text:p>db</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>id</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>Min-unit</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>Min-value</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>Max-unit</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce10" office:value-type="string">
				<text:p>Max-value</text:p>
			</table:table-cell>
		</table:table-row>
		<!--Apply templates-->
		<xsl:apply-templates/>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce3"/>
			<table:table-cell table:style-name="ce17"/>
			<table:table-cell table:style-name="ce17"/>
			<table:table-cell table:style-name="ce17"/>
			<table:table-cell table:style-name="ce17"/>
			<table:table-cell table:style-name="ce20"/>
		</table:table-row>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce4"/>
			<table:table-cell table:style-name="ce18"/>
			<table:table-cell table:style-name="ce18"/>
			<table:table-cell table:style-name="ce18"/>
			<table:table-cell table:style-name="ce18"/>
			<table:table-cell table:style-name="ce22"/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell table:number-columns-repeated="7"/>
		</table:table-row>
	</xsl:template>
	<!--Create a Substance row-->
	<xsl:template match="msds:substance">
		<table:table-row table:style-name="ro4">
			<table:table-cell/>
			<table:table-cell table:style-name="ce3" office:value-type="string">
				<text:p>
					<xsl:value-of select="@db"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce17" office:value-type="string">
				<text:p>
					<xsl:value-of select="@id"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce17" office:value-type="string">
				<text:p>
					<xsl:value-of select="msds:concentration/msds:min/@unit"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce17" office:value-type="float"
				office:value="{msds:concentration/msds:min}">
				<text:p>
					<xsl:value-of select="msds:concentration/msds:min"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce17" office:value-type="string">
				<text:p>
					<xsl:value-of select="msds:concentration/msds:max/@unit"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce20" office:value-type="float"
				office:value="{msds:concentration/msds:max}">
				<text:p>
					<xsl:value-of select="msds:concentration/msds:max"/>
				</text:p>
			</table:table-cell>
		</table:table-row>
	</xsl:template>
	<!--Create the Regulatory information section-->
	<xsl:template match="msds:regulatoryInformation">
		<table:table-row table:style-name="ro1">
			<!--Create title for the section-->
			<table:table-cell table:style-name="msds-Section" office:value-type="string">
				<text:p>Regulatory information</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="5"/>
		</table:table-row>
		<!--Apply templates for Hazard symbols-->
		<xsl:apply-templates select="msds:hazardSymbols"/>
		<!--Create the section and rows for Regulatory information paragraphs-->
		<table:table-row table:style-name="ro1">
			<table:table-cell/>
			<table:table-cell table:style-name="msds-Section" office:value-type="string">
				<text:p>Regulatory information paragraphs</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="4"/>
		</table:table-row>
		<table:table-row table:style-name="ro6">
			<table:table-cell/>
			<table:table-cell table:style-name="ce1" office:value-type="string">
				<text:p>pos</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>Countries</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>lang</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce15" office:value-type="string">
				<text:p>title</text:p>
			</table:table-cell>
			<table:table-cell table:style-name="ce10" office:value-type="string">
				<text:p>text</text:p>
			</table:table-cell>
			<table:table-cell/>
		</table:table-row>
		<!--Create the paragraph rows-->
		<xsl:for-each select="msds:paragraph">
			<xsl:apply-templates select="."/>
		</xsl:for-each>
		<!--Create the two empty rows at the end of this table -->
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce3"/>
			<table:table-cell table:style-name="ce17" table:number-columns-repeated="3"/>
			<table:table-cell table:style-name="ce20"/>
			<table:table-cell/>
		</table:table-row>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce4"/>
			<table:table-cell table:style-name="ce18" table:number-columns-repeated="3"/>
			<table:table-cell table:style-name="ce22"/>
			<table:table-cell/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell table:number-columns-repeated="7"/>
		</table:table-row>
		<!--Apply templates for Safety phrases-->
		<xsl:apply-templates select="msds:safetyPhrases"/>
		<!--Apply templates for Risk phrases-->
		<xsl:apply-templates select="msds:riskPhrases"/>
		<table:table-row table:style-name="ro3">
			<table:table-cell table:number-columns-repeated="6"/>
		</table:table-row>
	</xsl:template>
	<!--
		Create the Hazard symbols, Safety phrases and Risk phrases sections
	-->
	<xsl:template match="msds:hazardSymbols | msds:safetyPhrases | msds:riskPhrases">
		<table:table-row table:style-name="ro1">
			<table:table-cell/>
			<table:table-cell table:style-name="msds-Section" office:value-type="string">
				<text:p>
					<xsl:choose>
						<xsl:when test="local-name(.) = 'hazardSymbols'">
							<xsl:text>Hazard symbols</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'safetyPhrases'">
							<xsl:text>Safety phrases</xsl:text>
						</xsl:when>
						<xsl:when test="local-name(.) = 'riskPhrases'">
							<xsl:text>Risk phrases</xsl:text>
						</xsl:when>
					</xsl:choose>
				</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="4"/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell/>
			<table:table-cell table:style-name="ce5" office:value-type="string">
				<text:p>key</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="4"/>
		</table:table-row>
		<!--Apply templates-->
		<xsl:apply-templates/>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce7"/>
			<table:table-cell table:number-columns-repeated="4"/>
		</table:table-row>
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce8"/>
			<table:table-cell table:number-columns-repeated="4"/>
		</table:table-row>
		<table:table-row table:style-name="ro3">
			<table:table-cell table:number-columns-repeated="6"/>
		</table:table-row>
	</xsl:template>
	<!--Create the Hazard symbol, Safety phrase and Risk phrase rows-->
	<xsl:template match="msds:hazardSymbol | msds:safetyPhrase | msds:riskPhrase">
		<table:table-row table:style-name="ro2">
			<table:table-cell/>
			<table:table-cell table:style-name="ce7" office:value-type="string">
				<text:p>
					<xsl:value-of select="@key"/>
				</text:p>
			</table:table-cell>
			<table:table-cell table:number-columns-repeated="4"/>
		</table:table-row>
	</xsl:template>
	<!--blocking templates-->
	<xsl:template match="*"/>
	<xsl:template match="msds:name"/>
	<xsl:template match="*" mode="NestedInRegulatoryInformation"/>
	<xsl:template match="text:line-break"/>
	<xsl:template match="office:forms"/>
	<xsl:template match="text:sequence-decls"/>
</xsl:stylesheet>
